<template>
  <div class="ne-wrap">
    <el-select class="ne-lf-append" v-bind="$props" v-model="select">
      <el-option
        v-for="item in options"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      ></el-option>
    </el-select>
  </div>
</template>

<script>
import { Select } from "element-ui";
export default {
  name: "SideSelect",
  props: {
    ...Select,
    value: {
      type: String,
      default: "",
    },
    options: {
      type: Array,
      default: () => {
        return [
          { value: "1", label: "精确" },
          { value: "2", label: "模糊" },
        ];
      },
    },
  },
  computed: {
    select: {
      get: function () {
        return this.value;
      },
      set: function (newValue) {
        this.$emit("input", newValue); // 通过 input 事件更新 model
      },
    },
  },
};
</script>

<style lang="scss" scoped>
.ne-wrap {
 ::v-deep .el-select .el-input {
    width: .8rem;
  }
  ::v-deep .input-with-select .el-input-group__prepend {
    background-color: #fff;
  }
}
</style>
